<?PHP
mp('Content Module Loaded');
global $conf;
mp("get Categories for menu");
$h_category=new content_category;
$h_category->get_category();
foreach($h_category->data as $z)
{
	
	if($z['type']=='video' && $z['parent']==0 && $z['menu']=='enabled' && $z['status']=='enabled')
	{
	
		$i[$z['id']]=$z;

	}	
	
	if($z['type']=='video' && $z['parent']!=0 && $z['menu']=='enabled' && $z['status']=='enabled')
	{
		$i[$z['parent']]['child'][$z['id']]=$z;
	}	
}
$header_dropdown=$i;


if(!$c_content && $conf->qm[0]=='content' || !$c_content && $conf->qm[0]=='watch' || !$c_content && $conf->qm[0]=='community' || !$c_content && $conf->qm[0]=='popout' || !$c_content && $conf->qm[0]=='article' || !$c_content && $conf->qm[0]=='gallery')
{
	$c_content=true;
	$access_of=false;
	$conf->page_render='admin/m/content/o_content.php';
	
	$c_content=new content;
	$category=new content_category;

	if(!$conf->qm[0]=='community')
	{
		
	
		
				mp('Get content, we dont have community');
			$c_content->where['id']=$conf->qm[1];
			$c_content->get_content();
			
	
			
		if(!empty($c_content->data) && $conf->qm[0]=='content')
		{
			$view=true;
		
			$conf->page_render='assets/pages/content.php';
		}
		if(!empty($c_content->data) && $conf->qm[0]=='community')
		{
			$view=true;
			
			$conf->page_render='assets/pages/content.php';
		}
		 
		if($conf->qm[0]=='popout')
		{
				mp('POPPING OUT');
			
		//		$view=true;
			
  			$c_content->get_content_addons();

			$content=$c_content->data;
			
			if(!empty($c_content->data))
			{
				
				mp('W');
				if(!empty($c_content->data['player_page']))
				{
			
					$view=true;
					$conf->popout=true;
					$conf->page_render='assets/pages/'.$c_content->data["player_page"].'.php';
		
				}
				else
				{
					$view=true;
					$conf->popout=true;
					$conf->page_render='assets/pages/popout.php';
				
				}
			}

			
		}
		
		if(!empty($c_content->data) && $conf->qm[0]=='article')
		{
			$view=true;
			
			$conf->page_render='assets/pages/article.php';
		}
		
		else if(!empty($c_content->data) && $conf->qm[0]=='gallery')
		{
			$view=true;
			
			$conf->page_render='assets/pages/gallery.php';
		}
	
	
	
	}


	
	

	
	
}

if($view)
{		
	
		include 'c_content_view.php';
		
}
	//check if youre logged in fb
if($home)
{
	
	include 'c_home.php';


}

?>